﻿
@{
    ViewBag.Title = "商家提现";
    Layout = "~/Views/Shared/DetailsInfoLayout.cshtml";
}

@section CSS{
    <link href="~/Content/css/layerui/layui.css" rel="stylesheet" />
    <link href="~/Content/js/UploadImg/css/webuploader.css" rel="stylesheet" />
}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="ibox-content">
                <form class="form-horizontal" id="form-add">
                    <input type="hidden" id="id" name="id" value="@ViewBag.id" />
                    <div class="form-group">
                        <label class="col-sm-3 control-label">审核状态：</label>
                        <div class="col-sm-9">
                            <select style="width:200px;" name="status" id="status" class="form-control" required="" aria-required="true">
                                <option value="1">提现中</option>
                                <option value="3">提现成功</option>
                                <option value="4">拒绝提现</option>
                            </select>
                            <span class="help-block m-b-none"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">备注/拒绝原因：</label>
                        <div class="col-sm-9">
                            <textarea name="remark" id="remark" maxlength="500" class="form-control" placeholder="请输入备注" rows="3"></textarea>
                            <span class="help-block m-b-none"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-3">
                            <button class="btn btn-primary" type="submit">保存内容</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
@section JS{
    <script src="~/Content/js/jquery.form.js"></script>
    <script src="~/Content/plugins/validate/jquery.validate.min.js"></script>
    <script src="~/Content/plugins/validate/messages_zh.min.js"></script>

    <script type="text/javascript">
        $("#form-add").validate({
            ajaxPost: true,
            submitHandler: function (form) {
                infosubmit();
            }
        });

        var flag = true;
        function infosubmit() {
            if (flag) {
                $("#form-add").ajaxSubmit({
                    url: "/finance/CheckshopWithdrawal", type: "POST",
                    dataType: "json",
                    success: function (result) {
                        if (result.status == "y") {
                            parent.layer.msg("操作成功", { time: 1200 }, function () {
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.location.replace(parent.location.href);
                                parent.layer.close(index);
                            });
                        }
                        else {
                            parent.layer.msg(result.info, { time: 2000 });
                            flag = true;
                        }
                    }
                });
            }
        }

    </script>
}

